package com.fang.gulimall.admin.domain.system.dept.query;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fang.gulimall.admin.common.core.page.AbstractQuery;
import com.fang.gulimall.admin.domain.system.dept.db.SysDeptEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @ClassName DeptQuery
 * @Description TODO
 * @Author fangge
 * @Date 2024/6/13 6:47
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class DeptQuery extends AbstractQuery<SysDeptEntity> {

    private Long deptId;

    private Long parentId;


    @Override
    public QueryWrapper<SysDeptEntity> addQueryCondition() {
        return new QueryWrapper<SysDeptEntity>()
                .eq(parentId != null, "parent_id", parentId);
    }
}

